package com.mbl.base.modular.mall.service.impl;

import com.mbl.base.modular.mall.entity.Address;
import com.mbl.base.modular.mall.mapper.AddressMapper;
import com.mbl.base.modular.mall.service.IAddressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 收货地址表 服务实现类
 * </p>
 *
 * @author lwj
 * @since 2020-03-21
 */
@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements IAddressService {

    @Override
    public Address findDefault(Long userId) {
        return query().eq("user_id",userId).eq("is_default",true).one();
    }
}
